<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        * {
            padding: 0;
            margin: 0;
        }

        div {
            width: 500px;
            height: 500px;
            background-color: burlywood;
        }
    </style>


</head>

<body>

    <button>fadeIn</button>
    <button>fadeOut</button>
    <button>fadeToggle</button>
    <button>fadeTo</button>

    <div></div>


    <script src="./jquery/jquery-3.6.0.min.js"></script>
    <script>
        $("button:nth-child(1)").click(function () {

            $("div").fadeIn(1000, "linear", function () {
                console.log("slideDown结束了")
            })


        })
        $("button:nth-child(2)").click(function () {
            $("div").fadeOut(1000, "linear", function () {
                console.log("slideUp结束了")
            })


        })
        $("button:nth-child(3)").click(function () {
            $("div").fadeToggle(1000, "linear", function () {
                console.log("slideToggle结束了")
            })


        })
        $("button:nth-child(4)").click(function () {
            $("div").fadeTo(1000, 0.34,"linear", function () {
                console.log("运动到了指定的透明度")
            })


        })
    
    </script>
</body>

</html>